package com.ruoyi.danny.util;

import org.springframework.stereotype.Component;

@Component("expExceptionUtils") // 注册为Spring Bean
public class ExpressionExceptionUtils {

    // 直接抛出异常
    public void throwException(String message) {
        throw new RuntimeException(message); // 抛出自定义异常信息
    }

    // 条件满足时抛出异常（更常用）
    public void throwIf(boolean condition, String message) {
        if (condition) {
            throw new RuntimeException(message);
        }
    }
}